/*
package com.luxoft.scoremanager.server.service.impl;

import com.luxoft.scoremanager.server.model.bean.ScorePackageBean;
import com.luxoft.scoremanager.server.model.entity.ScorePackage;
import com.luxoft.scoremanager.server.repository.ScorePackageRepository;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.transaction.annotation.Transactional;
import com.luxoft.scoremanager.server.model.bean.ComponentBean;
import com.luxoft.scoremanager.server.model.bean.ScorePackageBean;
import com.luxoft.scoremanager.server.model.bean.StaticDataBean;
import com.luxoft.scoremanager.server.model.entity.ComponentValue;
import com.luxoft.scoremanager.server.model.entity.ScorePackage;
import com.luxoft.scoremanager.server.model.entity.StaticData;
import javax.annotation.Resource;

import static com.google.common.base.Preconditions.checkArgument;


@Service
public class RepositoryPackageManagerService {

    private static final Logger LOG = LoggerFactory.getLogger(RepositoryPackageManagerService.class);

    @Resource
    private ScorePackageRepository scorePackageRepository;

    public RepositoryPackageManagerService() {

    }

    @Transactional

    public ScorePackage update(ScorePackageBean scorePackageBean) {
        checkArgument(scorePackageBean != null, "score package should be provided");
        //this is null checking method
        //noinspection ConstantConditions
        checkArgument(scorePackageBean.getId() != null, "score package id should be provided");
        //argument is checked
        //noinspection ConstantConditions
        ScorePackage scorePackage = scorePackageRepository.findOne(Long.valueOf(scorePackageBean.getId()));
        scorePackage.setStage(scorePackageBean.getStage());
        scorePackageRepository.saveAndFlush(scorePackage);
        */
/*if (scorePackageBean.getComponents().size() > 1) {
            this.updateComponentListInScorePackageByPackageId(scorePackageBean.getId(), scorePackageBean.getComponents());
        } else if (scorePackageBean.getComponents().size() == 1) {
            this.updateComponentInScorePackageByPackageId(scorePackageBean.getId(), scorePackageBean.getComponents().get(0));
        }
        ScorePackage scorePackage = scorePackageRepository.findOne(Long.valueOf(updated.getId()));

        scorePackageRepository.saveAndFlush(updated)*//*

        //  scorePackage.update(updated.getFirstName(), updated.getLastName());

        return scorePackage;
    }


}
*/
